package com.bys.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.UUID;
import java.util.concurrent.TimeUnit;

@RestController
@Slf4j
public class PayController {
    @GetMapping("/feign/ok")
    public String feignOk(){
        String id = UUID.randomUUID().toString().replaceAll("-", "");
        return id + "     ****ok***" + Thread.currentThread().getName();
    }
    @GetMapping("/feign/timeout")
    public String feign_timeout() throws InterruptedException {
        TimeUnit.MILLISECONDS.sleep(1000);
        String id = UUID.randomUUID().toString().replaceAll("-", "");
        log.info(id + "     ****时间超时***" + Thread.currentThread().getName());
        return id + "     ****时间超时***" + Thread.currentThread().getName();

    }
    @GetMapping("/feign/err")
    public String feign_err(){
        int a = 10 / 0 ;
        String id = UUID.randomUUID().toString().replaceAll("-", "");
        return id + "     ****错误页面***" + Thread.currentThread().getName();

    }


}
